package com.ma.service.impl;


import com.ma.entity.SysRoleMenu;
import com.ma.mapper.SysRoleMenuMapper;
import com.ma.service.SysRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
  */
@Service
public class SysRoleMenuServiceImpl implements SysRoleMenuService {
    @Autowired
    private SysRoleMenuMapper sysRoleMenuMapper;
    @Override
    public List<Long> selectMenuIdById(Long id) {
        return sysRoleMenuMapper.selectMenuIdById(id);
    }

    @Override
    public void deleteByMenuId(Long id) {
        sysRoleMenuMapper.deleteByMenuId(id);
    }

    @Override
    public List<SysRoleMenu> selectMenuIdByRoleId(Long id) {
        return sysRoleMenuMapper.selectMenuIdByRoleId(id);
    }



    @Override
    public void saveByRoleMenuList(SysRoleMenu sysRoleMenu) {
        sysRoleMenuMapper.saveByRoleMenuList(sysRoleMenu);
    }

    @Override
    public void deleteRoleMenuByRoleId(Long roleId) {
        sysRoleMenuMapper.deleteRoleMenuByRoleId(roleId);
    }

    @Override
    public int countByRoleId(Long parentId,Long roleId) {
        return sysRoleMenuMapper.countByRoleId(parentId,roleId);
    }
}
